PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Integer

A value of class Integer is a positive or negative number without a fractional part.

LITERAL EXPRESSIONS
1
2
-1
1000
PROPERTY
Class
The class identifier for the object. This property is read-only, and its value is always integer .
ELEMENTS

None

OPERATORS

The Div operator always returns an Integer value as its result. The + , - , * , Mod, and ^ operators return values of type Integer or Real.

The operators that can have Integer values as operands are + , - , * , ÷ (or / ), Div, Mod, ^ , = , , > , , < , and .

COERCIONS SUPPORTED

AppleScript supports coercion of an Integer value to a single-item list, a real number, or a string.

You can also coerce an integer using the synonym Number, but the class of the resulting value remains unchanged:

set x to 7 as number
class of x --result: integer
NOTES

The largest value that can be expressed as an integer in AppleScript is 536870909, which is equal to (2 29 - 3). Larger integers (positive or negative) are converted to real numbers (expressed in exponential notation) when scripts are compiled.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)